import gc,machine,sys,micropython,os

def flash():
    stat = os.statvfs('/')
    total_flash = stat[0]*stat[2]
    use_flash=stat[0]*(stat[2]-stat[3])
    free_flash = stat[0]*stat[3]
    print("FALSH:",total_flash/1024,"KB",free_flash/1024,"KB",use_flash/1024,"KB")
    return (total_flash,free_flash,use_flash)

def show_info():
    mpy=sys.implementation.version
    print(sys.implementation._machine)
    print("SYSTEM:",sys.version)
    print("CPU:",machine.freq()/1000000,"MHZ")
    micropython.mem_info()
    gc.collect()
    print("RAM Free:",gc.mem_free()/1024,"KB")
    flash()

if __name__=="__main__":
    show_info()
